package com.imonsoft.sqm.dao.sys;

import java.util.List;

import org.springframework.orm.ibatis.support.SqlMapClientDaoSupport;
import org.springframework.stereotype.Repository;

import com.imonsoft.sqm.pojo.sys.UserRole;
import com.imonsoft.sqm.pojo.sys.UserRoleExample;
import com.imonsoft.sqm.pojo.sys.UserRoleKey;

@SuppressWarnings("deprecation")
@Repository("userRoleDAO")
public class UserRoleDAOImpl extends SqlMapClientDaoSupport implements UserRoleDAO {

    /**
     * This method was generated by Apache iBATIS ibator.
     * This method corresponds to the database table tr_user_role
     *
     * @ibatorgenerated Mon Jun 10 21:10:37 CST 2013
     */
    public UserRoleDAOImpl() {
        super();
    }

    /**
     * This method was generated by Apache iBATIS ibator.
     * This method corresponds to the database table tr_user_role
     *
     * @ibatorgenerated Mon Jun 10 21:10:37 CST 2013
     */
    public int countUserRoleByExample(UserRoleExample example) {
        Integer count = (Integer)  getSqlMapClientTemplate().queryForObject("tr_user_role.ibatorgenerated_countByExample", example);
        return count;
    }

    /**
     * This method was generated by Apache iBATIS ibator.
     * This method corresponds to the database table tr_user_role
     *
     * @ibatorgenerated Mon Jun 10 21:10:37 CST 2013
     */
    public int deleteUserRoleByExample(UserRoleExample example) {
        int rows = getSqlMapClientTemplate().delete("tr_user_role.ibatorgenerated_deleteByExample", example);
        return rows;
    }

    /**
     * This method was generated by Apache iBATIS ibator.
     * This method corresponds to the database table tr_user_role
     *
     * @ibatorgenerated Mon Jun 10 21:10:37 CST 2013
     */
    public int deleteUserRoleByPrimaryKey(UserRoleKey key) {
        int rows = getSqlMapClientTemplate().delete("tr_user_role.ibatorgenerated_deleteByPrimaryKey", key);
        return rows;
    }

    /**
     * This method was generated by Apache iBATIS ibator.
     * This method corresponds to the database table tr_user_role
     *
     * @ibatorgenerated Mon Jun 10 21:10:37 CST 2013
     */
    public void insertUserRole(UserRole record) {
        getSqlMapClientTemplate().insert("tr_user_role.ibatorgenerated_insert", record);
    }

    /**
     * This method was generated by Apache iBATIS ibator.
     * This method corresponds to the database table tr_user_role
     *
     * @ibatorgenerated Mon Jun 10 21:10:37 CST 2013
     */
    public void insertUserRoleSelective(UserRole record) {
        getSqlMapClientTemplate().insert("tr_user_role.ibatorgenerated_insertSelective", record);
    }

    /**
     * This method was generated by Apache iBATIS ibator.
     * This method corresponds to the database table tr_user_role
     *
     * @ibatorgenerated Mon Jun 10 21:10:37 CST 2013
     */
    @SuppressWarnings("unchecked")
    public List<UserRole> selectUserRoleByExample(UserRoleExample example) {
        List<UserRole> list = getSqlMapClientTemplate().queryForList("tr_user_role.ibatorgenerated_selectByExample", example);
        return list;
    }

    /**
     * This method was generated by Apache iBATIS ibator.
     * This method corresponds to the database table tr_user_role
     *
     * @ibatorgenerated Mon Jun 10 21:10:37 CST 2013
     */
    public UserRole selectUserRoleByPrimaryKey(UserRoleKey key) {
        UserRole record = (UserRole) getSqlMapClientTemplate().queryForObject("tr_user_role.ibatorgenerated_selectByPrimaryKey", key);
        return record;
    }

    /**
     * This method was generated by Apache iBATIS ibator.
     * This method corresponds to the database table tr_user_role
     *
     * @ibatorgenerated Mon Jun 10 21:10:37 CST 2013
     */
    public int updateUserRoleByExampleSelective(UserRole record, UserRoleExample example) {
        UpdateByExampleParms parms = new UpdateByExampleParms(record, example);
        int rows = getSqlMapClientTemplate().update("tr_user_role.ibatorgenerated_updateByExampleSelective", parms);
        return rows;
    }

    /**
     * This method was generated by Apache iBATIS ibator.
     * This method corresponds to the database table tr_user_role
     *
     * @ibatorgenerated Mon Jun 10 21:10:37 CST 2013
     */
    public int updateUserRoleByExample(UserRole record, UserRoleExample example) {
        UpdateByExampleParms parms = new UpdateByExampleParms(record, example);
        int rows = getSqlMapClientTemplate().update("tr_user_role.ibatorgenerated_updateByExample", parms);
        return rows;
    }

    /**
     * This method was generated by Apache iBATIS ibator.
     * This method corresponds to the database table tr_user_role
     *
     * @ibatorgenerated Mon Jun 10 21:10:37 CST 2013
     */
    public int updateUserRoleByPrimaryKeySelective(UserRole record) {
        int rows = getSqlMapClientTemplate().update("tr_user_role.ibatorgenerated_updateByPrimaryKeySelective", record);
        return rows;
    }

    /**
     * This method was generated by Apache iBATIS ibator.
     * This method corresponds to the database table tr_user_role
     *
     * @ibatorgenerated Mon Jun 10 21:10:37 CST 2013
     */
    public int updateUserRoleByPrimaryKey(UserRole record) {
        int rows = getSqlMapClientTemplate().update("tr_user_role.ibatorgenerated_updateByPrimaryKey", record);
        return rows;
    }

    /**
     * This class was generated by Apache iBATIS ibator.
     * This class corresponds to the database table tr_user_role
     *
     * @ibatorgenerated Mon Jun 10 21:10:37 CST 2013
     */
    private static class UpdateByExampleParms extends UserRoleExample {
        private Object record;

        public UpdateByExampleParms(Object record, UserRoleExample example) {
            super(example);
            this.record = record;
        }

        @SuppressWarnings("unused")
		public Object getRecord() {
            return record;
        }
    }
}